var express = require("express");
var router = express.Router();

// userDB
const usersDB = require("../lowdb/index.js").users;

// 首页路由
router.get("/", function (req, res, next) {
  res.header("X-Powered-By","3.2.1")
  res.header("Cache-Contro","no-store")
  const userList = usersDB.get("userList").value();
  res.send({
    name: userList,
  });
});

// 获取用户接口
router.get("/getList", function (req, res, next) {
  const userList = usersDB.get("userList").value();
  res.send({
    userList,
  });
});

module.exports = router;
